/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package be.ugent.medirem.persistence.entity.details;

import be.ugent.medirem.persistence.util.DateFormatter;
import be.ugent.medirem.persistence.util.TaskStatus;
import java.util.Date;

/**
 *
 * @author Thomas Roelens
 */
public class MedicationTaskDetails {
    
    private Long id;
    private PrescriptionDetails prescription;
    private TaskStatus status;
    private Date taskTime;
    private Date completionTime;

    public MedicationTaskDetails() {
    }

    public MedicationTaskDetails(Long id, PrescriptionDetails p, TaskStatus status, Date time, Date completion) {
        this.id = id;
        this.prescription = p;
        this.status = status;
        this.taskTime = time;
        this.completionTime = completion;
    }

    public Date getCompletionTime() {
        return completionTime;
    }

    public void setCompletionTime(Date completionTime) {
        this.completionTime = completionTime;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public PrescriptionDetails getPrescription() {
        return prescription;
    }

    public void setPrescription(PrescriptionDetails prescription) {
        this.prescription = prescription;
    }

    public TaskStatus getStatus() {
        return status;
    }

    public void setStatus(TaskStatus status) {
        this.status = status;
    }

    public Date getTaskTime() {
        return taskTime;
    }

    public void setTaskTime(Date taskTime) {
        this.taskTime = taskTime;
    }

    public String toJson() {
        return "task:{id:"+id+",status:'"+status.getTitle()+"',taskTime:'"+DateFormatter.format(taskTime, "d MMM yyyy HH:mm")+"',completionTime:'"+DateFormatter.format(completionTime, "d MMM yyyy HH:mm")+"',"+prescription.toJson()+"}";
    }

}
